package com.zuihai.app.mvp.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jess.arms.base.BaseFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Panda_Program on 2017/9/16 0016.
 */

public class MyPagerAdapter extends FragmentPagerAdapter {
    private List<BaseFragment> mFragments ;
    private ArrayList<Fragment> mFragments1 ;
    public MyPagerAdapter(FragmentManager fm,ArrayList<Fragment> mFragments1, String[] mTitles ) {
        super(fm);
        this.mFragments1=mFragments1;
        this.mTitles=mTitles;
    }
    private  String[] mTitles;
    public MyPagerAdapter(FragmentManager fm,List<BaseFragment> mFragments, String[] mTitles ) {
        super(fm);
        this.mFragments=mFragments;
        this.mTitles=mTitles;
    }

    @Override
    public int getCount() {
        return mFragments1.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments1.get(position);
    }
}
